import { get, put, upload } from '@/utils/request'

// 获取用户信息
export const getUserProfileAPI = () => {
  return get('/api/auth/profile')
}

// 更新用户信息
export const updateUserProfileAPI = (data) => {
  return put('/api/auth/profile', {
    username: data.username,
    email: data.email,
    avatar: data.avatar,
    themePreference: data.themePreference
  })
}

// 修改密码
export const changePasswordAPI = (data) => {
  return put('/api/user/password', {
    oldPassword: data.oldPassword,
    newPassword: data.newPassword
  })
}

// 头像上传
export const uploadAvatarAPI = (filePath) => {
  return upload('/api/user/avatar', filePath, 'avatar')
}

// 更新用户设置
export const updateUserSettingsAPI = (settings) => {
  return put('/api/user/settings', settings)
}

// 注销账号
export const deleteAccountAPI = () => {
  return put('/api/user/delete-account')
} 